﻿<Window x:Class="SolickManagerV3_4.Windows.AddOrEditCategoryWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SolickManagerV3_4.Windows"
        mc:Ignorable="d"
        WindowStartupLocation="CenterScreen"
        Icon="Images/SolulCompIcon.ico"
        Title="SoulComp Manager" Height="700" Width="400">
    <Border Width="350"
            Height="620"
            CornerRadius="10"
            Background="#3993DD"
            Padding="25">
        <StackPanel>
            <TextBlock Foreground="White"
                       Height="25"
                       VerticalAlignment="Top"
                       HorizontalAlignment="Center"
                       FontSize="20"
                       FontFamily="Inter"
                       FontWeight="Medium"
                       Text="Категория"
                       Margin="0 0 0 15"/>

            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Название"
                               FontFamily="Inter"
                               FontSize="16"
                               Height="20"
                               FontWeight="Medium"
                               Foreground="White"/>
                <TextBox Text="{Binding Category.Title}"
                             Style="{DynamicResource RoundTextBox}"
                             Height="20"
                             Width="215"
                             Margin="10 0 0 0"/>
            </StackPanel>
            
            <Border CornerRadius="10"
                                Background="White"
                                BorderThickness="0"
                                Width="300"
                                MinHeight="100"
                                Padding="5"
                                Margin="0 10 0 0">
                            <StackPanel 
                                    Width="290"
                                    Height="190">
                                <Label  Content="Характеристики:"
                                        FontSize="14"
                                        Foreground="Black"
                                        FontFamily="Inter/#Inter-V.ttf"
                                        Height="24"/>
                                <ListView x:Name="CategoryCharacteristicsListView" 
                                          ItemsSource="{Binding CategoryCharacteristics}" 
                                          BorderThickness="0"
                                          SelectedItem="{Binding SelectedCategoryCharacteristic, UpdateSourceTrigger=PropertyChanged}"
                                          FontSize="12"
                                          Foreground="Black"
                                          FontFamily="Inter/#Inter-V.ttf"
                                          Width="290"
                                          Height="145"
                                          HorizontalAlignment="Center">
                                    <ListView.ContextMenu>
                                        <ContextMenu>
                                            <MenuItem Header="Удалить" Click="DeleteCharacteristic"/>
                                        </ContextMenu>
                                    </ListView.ContextMenu>
                    </ListView> 
                            </StackPanel>
                        </Border>
            
            <StackPanel Orientation="Horizontal" Margin="0 20 0 0">
                <TextBlock Text="Поиск"
                               FontFamily="Inter"
                               FontSize="16"
                               Height="20"
                               FontWeight="Medium"
                               Foreground="White"/>
                
                
                <TextBox Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"
                             Style="{DynamicResource RoundTextBox}"
                             Height="20"
                             Width="215"
                             Margin="35 0 0 0"/>
            </StackPanel>
            <Border CornerRadius="10"
                                Background="White"
                                BorderThickness="0"
                                Width="300"
                                MinHeight="100"
                                Padding="5"
                                Margin="0 10 0 0">
                <StackPanel 
                                    Width="290"
                                    Height="170">
                    <Label  Content="Характеристики:"
                                        FontSize="14"
                                        Foreground="Black"
                                        FontFamily="Inter/#Inter-V.ttf"
                                        Height="24"/>
                    <ListView BorderThickness="0"
                                         ItemsSource="{Binding Characteristics}"
                                         SelectedItem="{Binding SelectedCharacteristic, UpdateSourceTrigger=PropertyChanged}"
                                         FontSize="12"
                                         Foreground="Black"
                                         FontFamily="Inter/#Inter-V.ttf"
                                         Width="290"
                                         Height="145"
                                         HorizontalAlignment="Center">
                        <ListView.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="Добавить" Click="AddCharacteristic"/>
                            </ContextMenu>
                        </ListView.ContextMenu>
                    </ListView>
                </StackPanel>
            </Border>

            <Button x:Name="SaveButton"
                    Style="{DynamicResource ButtonRoundStyle}"
                    Content="Сохранить"
                    Width="260"
                    Margin="0 30 0 0"
                    Height="35"
                    Background="White"
                    FontSize="20"
                    FontWeight="Medium"
                    FontFamily="Inter"
                    Click="Save"/>
        </StackPanel>
    </Border>
</Window>
